function [subsets]=genSubSets(k, size)
    if nargin < 1
        subsets=genSubSets(3,7);
        for i=1:length(subsets)
            disp(subsets{i})
        end
        return;
    end
    if k==1
        subsets=cell(size,1);
        for i=1:size
            subsets{i}=[i];
        end
        return;
    else
        localsubsets=genSubSets(k-1,size);
        subsets={};
        for i=1:length(localsubsets)
            maxelem = max(localsubsets{i});
            for j=1:size
                if j<=maxelem
                    continue;
                end
                subsets{end+1}=[localsubsets{i},j];
            end
        end
    end
end


